//
//  GGAppServiceManager.h
//  TestAppDelegateService
//
//  Created by yuemei on 2017/9/21.
//  Copyright © 2017年 yuemei. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>


/**注册宏
 @param name 服务名
 */
#define GG_EXPORT_SERVICE(name) \
+ (void)load {[[GGAppServiceManager sharedAppServiceManager] registerService:[self new]];} \
- (NSString *)serviceName { return @#name; }


//默认noNull
NS_ASSUME_NONNULL_BEGIN
@protocol GGAppService <UIApplicationDelegate>

@required
//注册服务名
-(NSString *)serviceName;
@end


@interface GGAppServiceManager : NSObject
    
+(instancetype)sharedAppServiceManager;
//注册服务
-(void)registerService:(id<GGAppService>)service;

//代理是否可以响应方法
-(BOOL)proxyCanResponseToSelector:(SEL)aSelector;

-(void)proxyForwardInvocation:(NSInvocation *)anInvocation;
@end
NS_ASSUME_NONNULL_END
